package com.vaadin.tutorial.crm.backend.repository;

import com.vaadin.tutorial.crm.backend.entity.Course;
import com.vaadin.tutorial.crm.backend.entity.SysRole;
import com.vaadin.tutorial.crm.backend.entity.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SysRoleRepository extends JpaRepository<SysRole, Long> {
    @Query("select r from SysRole r " +
            "where r.roleName like concat('%', :searchTerm, '%') " +
            "or r.roleName like concat('%', :searchTerm, '%')")
    List<SysRole> search(@Param("searchTerm") String searchTerm);
}
